import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leader_doctor_flutter/styles/colors.dart';

class TablePlaceholderWidget extends StatelessWidget {
  final String message;
  final String imagePath;
  final double yOffset;
  final double fontSize;
  final Color fontColor;

  TablePlaceholderWidget({
    this.message = "暂无数据",
    this.imagePath = "assets/images/icon_wallet_empty.webp",
    this.yOffset = 0.0, // 默认偏移量为0
    this.fontSize = 16.0, // 默认字号为 16
    this.fontColor = ColorRes.colorb4b2ff, // 默认字体颜色为 666
  });

  @override
  Widget build(BuildContext context) {
    // String defaultPlaceholderImagePath =
    //     "assets/images/icon_wallet_empty.png";
    // // 如果imagePath为空，则赋予默认的占位图地址
    // String finalImagePath =
    //     imagePath?.isEmpty ?? true ? defaultPlaceholderImagePath : imagePath;

    return Transform.translate(
      offset: Offset(0, yOffset),
      child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.asset(imagePath, width: 200.w, height: 200.w), // 调整图片大小
            SizedBox(height: 10.w),
            Text(
              message,
              style: TextStyle(fontSize: fontSize, color: fontColor),
            ),
          ],
        ),
      ),
    );
  }
}
